import { ViewBackState, ViewLayer, ViewMode } from "../../../../framework/view/ViewConsts";
import { ViewCtrlBase } from "../../../../framework/view/ViewCtrlBase";
import ViewMgr from "../../../../framework/view/ViewMgr";
import VCListViewDemo from "../../list_view_demo/vc/VCListViewDemo";
import ViewMainDemo from "../view/ViewMainDemo";


export default class VCMainDemo extends ViewCtrlBase {
    public static viewName: string = "ViewMainDemo";
    public static viewMode: ViewMode = ViewMode.SINGLE;
    public viewLayer: ViewLayer = ViewLayer.Layer_Scene;
    public viewClass: (typeof ViewMainDemo) = ViewMainDemo;

    onOpen(){
        super.onOpen();
    }

    onClose(){
        super.onClose();
    }
    /**注册系统事件 */
    registEvent(): void {
        
    }

    /**
     * @desc 检查是否可以使用返回键退出
     * 特殊情况,子类重写方法逻辑,返回ViewBackState.Close则不可以使用返回键关闭
     * @returns ViewBackState
     */
     public checkCanBack(): ViewBackState {
        return ViewBackState.Return;
    }

    onClick() {
        ViewMgr.getInstance().showView(VCListViewDemo);
        // GameUtils.showTip("asdfasfasdfasfewfq");
        // GameUtils.showMsgBox({
        //     type: MsgBoxType.OK_CANCEL,
        //     title: "测试标题",
        //     msg: "测试弹窗",
        //     hide_btn_close: false,
        //     bg_close: true,
        //     ok_callback: () => {
        //         Loger.log("弹窗点确定")
        //     },
        //     cancel_callback: () => {
        //         Loger.log("弹窗点取消")
        //     }
        // })
    }
}